package com.boat.starter.openfeign;

import feign.Logger;
import feign.RequestInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.boat.starter.openfeign.filter.FeginCallInterceptor;
import com.boat.starter.openfeign.filter.FeignLogger;

/**
 * starter自动配置
 * @author 周江
 *
 */
@Slf4j
@Configuration
public class FeignAutoConfiguration{

	@Bean
	public RequestInterceptor headerInterceptor() {
		return new FeginCallInterceptor();
	}

	@Bean
	public Logger.Level feignLogLevel(){
		return Logger.Level.BASIC;
	}

	@Bean
	Logger feignLogger() {
		return new FeignLogger();
	}
}
